//
//  Constant.h
//  RootDirectory
//
//  Created by Ryan on 13-2-28.
//  Copyright (c) 2013年 Ryan. All rights reserved.
//

/*
    RootDirectory 是Ryan创建的一个基本的项目模板，包含内容如下：
    AppDelegate                 - 包含了start - pannel的切换动画，后EnterBackground后的缓存处理及云备份处理
    StartViewController         - 启动view，可加载广告
    PannelViewController        - root view，管理项目中所有子模块
    ModuleViewControlers        - 所有子模块
 
    使用方法：
    1. 复制一份原项目文件
    2. 替换项目名称
    3. 重新建立项目名称匹配的scheme
    4. 讲各子模块加入ModuleViewControlers中
 */

#ifndef RootDirectory_Constant_h
#define RootDirectory_Constant_h

#import "MenuDataManager.h"

typedef enum {
    kProDetailFilter = 0,
    kProYuyueFilter,
    KProYuyueListFilter,
    kProYuyueListRightFilter,
    kProYuyueCancel,
    kAccountProductDetailFilter,
    kDynamicDetailFilter
}FitlerType;

typedef enum {
    kLocationLeft = 0,
    kLocationCenter,
    kLocationRight
}FilterLocationType;

typedef enum {
    kNonePage = 0,
    kAccountProductPage,
    kUserReminderPage
}LockPageType;

#define k3InchSizheAppHeight 460.f
#define Is4InchSizeScreen [UIScreen mainScreen].bounds.size.height==568.f?YES:NO
#define kAppCommonColor [UIColor colorWithRed:183.f/255.f green:152.f/255.f blue:105.f/255.f alpha:1.f]

#define kNaviHeaderHeight 44.f

#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/"]
#define kProductImagesDir  @"ProductImages"
#define kUserImagesDir     @"UserImages"
#define kUserDataFile      @"UserDataFile"
#define kUserRoleDataFile  @"UserRoleDataFile"
#define kUserIconSize CGSizeMake(120.f,120.f)

//GA
#define kGATrackingId       @"UA-11677600-2"

//apple api
#define kAppAppleId         @"563444753"
#define kAppRateUrl         @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@"
#define kAppDownloadUrl     @"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@&mt=8"

//Element Id
#define kOnlineProductStatusLabelId         @"V_025_004"
#define kOnlineProductDetailMoreButtonId    @"V_026_004"
#define kGesturePassCell                    @"V_012_004"

//Popover Filter
#define kDefaultPhoneNum        @"400-820-0025"
#define kPhoneName              @"电话咨询"
#define kFilterLocationType     @"FilterLocationType"
#define kFilterPropertiesKey    @"FilterPropertiesKey"
#define kFilterTypeKey          @"FilterTypeKey"

//NSUserDefaults key
#define kIsGestureAuthed        @"IsGestureAuthed"
#define kIsWelcomeShown         @"IsWelcomeShown"
//Pattern Lock

#define kPatternPasswordKey         @"PatternPasswordKey"       //保存当前的密码值
#define kPatternSaveOnKey           @"PatternSaveOnKey"         //1-打开手势密码 0-关闭手势密码
#define kPatternSaveOuttimeKey      @"PatternSaveOuttimeKey"    //1-超过锁屏时间30s 0-未超时

//Constant Values
#define kNetWorkErrorString @"网络错误"
#define kMaxCacheSize 50*1024*1024
#define IsDevicePhone5 [UIScreen mainScreen].bounds.size.height==568.f?YES:NO

#define kRGBHlightedColor [UIColor colorWithRed:224.f/255 green:188.f/255 blue:5.f/255 alpha:1]

#define kMaxFeedbackLength 2000

#define kRegisterPromptDict [NSDictionary dictionaryWithObjectsAndKeys:@"请输入%@。",@"F000001E",@"您输入的%@内容过长，请重新输入。",@"F000002E",@"您输入的%@内容格式不正确，请重新输入。",@"F000003E",@"您输入的%@与%@内容不一致，请重新输入。",@"F000004E",@"您所获取的密码已过期，请重新获取。",@"F000005E",@"请选择%@。",@"F000006E",@"该手机号码已存在，请重新选择手机号码。",@"F000007E",@"注册成功，欢迎您成为诺亚的注册会员。",@"F000001I",@"您已是认证会员，不需要重复注册。",@"F000008E",@" 请输入%@长度的%@",@"F000012E",@"您所输入的密码与确认密码不一致，请重新输入。",@"F000013E",@"您所输入的%@不正确，请重新输入。",@"F000014E",nil]
#define kAuthDayArray ((NSArray *)[NSArray arrayWithObjects:@"周一",@"周二",@"周三",@"周四",@"周五",nil])
#define kAuthTimeArray ((NSArray *)[NSArray arrayWithObjects:@"8:30-9:30",@"9:30-10:30",@"10:30-11:30",@"11:30-12:30",@"12:30-13:30",@"13:30-14:30",@"14:30-15:30",@"15:30-16:30",@"16:30-17:30",@"17:30-18:30",@"18:30-19:30",nil])

//NY log
/**
 所有的url请求后面加上logMessage参数，注意message的参数截止到func_id,后面的func_id需要手动拼接
 菜单权限接口使用kNYLogParams，其他接口使用kNYLogParamsCommon
 */
#define IsIPad() ([[UIDevice currentDevice].model rangeOfString:@"iPad"].length>0)
#define kNYAPP_ID               @"1"
#define kNYTERM_CODE            IsIPad()?@"00490003":@"00490001"
#define kNYDEVICE_ID            @""
#define kNYIMIS                 @""
#define kNYLogParams            [NSString stringWithFormat:@"&logMessage=%@|%@|%@|%@|%@|",kNYAPP_ID,kNYTERM_CODE,([NYMemberCenterDataManager sharedManager].loginMember.accountId==nil?@"":[NYMemberCenterDataManager sharedManager].loginMember.accountId),kNYDEVICE_ID,kNYIMIS]

#define kNYLogParamsCommon     [NSString stringWithFormat:@"&logMessage=%@|",([MenuDataManager sharedManager].uid)]
#define kNYLogCommon           [NSString stringWithFormat:@"?logMessage=%@|",([MenuDataManager sharedManager].uid)]

//Server configer/url
#define kServerAddress      @"http://210.13.87.204/"
#define kDynamicPasswordUrl [@"app/SendVerifyCodeForApp.jsp?callback=%@&phoneNum=%@&sendType=%@" stringByAppendingString:kNYLogParamsCommon]
#define kRegisterUrl        [@"app/RegisterAccountForApp.jsp?callback=%@&accountName=%@&mobilePhone=%@&isAgreementService=1&verifyCode=%@&willinBranch=%@"  stringByAppendingString:kNYLogParamsCommon]
#define kLoginUrl           [@"app/LoginApp.jsp?callback=%@&userName=%@&passWord=%@&ipAddress=%@" stringByAppendingString:kNYLogParamsCommon]
#define kApplyConfirmUrl    [@"app/AccountUserAuth.jsp?callback=%@&accountId=%@&bestContactTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kIndividualInformationUrl [@"app/FindPersonalInformation.jsp?callback=%@&accountId=%@" stringByAppendingString:kNYLogParamsCommon]

#define kBeginFindPwdUrl    [@"app/PasswordAppBeanFindPwd.jsp?callback=%@&mobilePhone=%@" stringByAppendingString:kNYLogParamsCommon]
#define kResetPwdUrl        [@"app/UpdatePWDByMobilePhoneApp.jsp?callback=%@&mobile=%@&newPassword1=%@&newPassword2=%@&oldPassword=%@" stringByAppendingString:kNYLogParamsCommon]

#define kManageQuestionUrl  [@"app/ManageQuestionForApp.jsp?callback=%@&accountId=%@&content=%@&mobile=%@" stringByAppendingString:kNYLogParamsCommon]


#define kChangeNameUrl      [@"app/ChangeUserNameForAPP.jsp?callback=%@&accountId=%@&newUserName=%@" stringByAppendingString:kNYLogParamsCommon]

#define kPersonalInfoUrl    [@"app/FindPersonalInformation.jsp?callback=%@&accountId=%@" stringByAppendingString:kNYLogParamsCommon]
#define kOldPhoneAuthUrl    [@"app/OldMobilePhoneVerify.jsp?callback=%@&accountId=%@&verifyCode=%@" stringByAppendingString:kNYLogParamsCommon]
#define kNewPhoneCommitUrl  [@"app/UpdateUserMobilePhone.jsp?callback=%@&accountId=%@&newMobile=%@&verifyCode=%@" stringByAppendingString:kNYLogParamsCommon]
#define kModifyPwdUrl       [@"app/PasswordAppBeanChangePwd.jsp?callback=%@&accountId=%@&oldPassword=%@&newPassword1=%@&newPassword2=%@" stringByAppendingString:kNYLogParamsCommon]
#define kPwdAuthUrl         [@"app/CheckUserPassWord.jsp?callback=%@&accountId=%@&password=%@" stringByAppendingString:kNYLogParamsCommon]
#define kSaveGestureStateUrl    [@"app/IsOpenGesturePassWordForApp.jsp?callback=%@&accountId=%@&openOrClose=%d" stringByAppendingString:kNYLogParamsCommon]
#define kSaveGesturePwdUrl  [@"app/ResetGesturePasswordForApp.jsp?callback=%@&accountId=%@&newPassword1=%@&newPassword2=%@" stringByAppendingString:kNYLogParamsCommon]
#define kOnlineProduectsUrl [@"app/FindAppProductList.jsp?callback=%@&accountId=%@&typeCustomer=%@&oderByCnd=%@&pageNo=%@&pageSize=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kProductDetailUrl   [@"app/FindBookingProductDetailsForApp.jsp?callback=%@&accountId=%@&productBookingId=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kYuyueProductUrl    [@"app/OrderProductForApp.jsp?callback=%@&SignDate=%@&productBookingId=%@&AccountId=%@&Amount=%d&Closedate=%@" stringByAppendingString:kNYLogParamsCommon]
#define kEditYuyueProductUrl    [@"app/UpdateProductOrderForApp.jsp?callback=%@&SignDate=%@&Amount=%d&Closedate=%@&CsodRemark=%@&SfOpportunityId=%@" stringByAppendingString:kNYLogParamsCommon]
#define kYuyueListUrl       [@"app/FindAccountPdOrderList.jsp?callback=%@&accountId=%@&flag=%d&pageNo=%d&pageSize=%d&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kDeleteYuYueUrl     [@"app/DeleteProductOrderForApp.jsp?callback=%@&accountId=%@&sfOpportunityId=%@" stringByAppendingString:kNYLogParamsCommon]
#define kCollectProUrl      [@"app/InsertAppTCsc2Collection.jsp?callback=%@&accountId=%@&objectId=%@" stringByAppendingString:kNYLogParamsCommon]
#define kMyReminderUrl      [@"app/FindExistPersistProductAttachInfoListForApp.jsp?callback=%@&accoutId=%@&productId=%@&objectType=%@&isNew=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kMykeepUrl          [@"app/FindAppCollectionList.jsp?callback=%@&accountId=%@&pageNo=%@&pageSize=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kCancelCollectProUrl    [@"app/CancelAppTCsc2Collection.jsp?callback=%@&accountId=%@&collectionIds=%@" stringByAppendingString:kNYLogParamsCommon]
#define kYuyueDetailUrl     [@"app/FindProductDetailSingle.jsp?callback=%@&sfOpportunityId=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kMenuListUrl        [@"app/AccountPowerForApp.jsp?callback=%@&accountId=%@" stringByAppendingString:kNYLogParams]
#define kSynthesizeMenuUrl  [@"app/SaveAccountNewSeqForApp.jsp?callback=%@&accountId=%@&funcId=%@&newSeq=%@" stringByAppendingString:kNYLogParamsCommon]
#define kChangeUserIconUrl  [@"app/UpdateAccountImage.jsp" stringByAppendingString:kNYLogCommon]

#define kFindDictBykindTypeUrl [@"app/FindTopCodeStringByKindTypeForApp.jsp?callback=%@&kindType=%@" stringByAppendingString:kNYLogParamsCommon]
#define kCancelYuyueUrl     [@"app/CancleProductForApp.jsp?callback=%@&accountId=%@&sfOpportunityId=%@&CsodChgReason=%@&csodRemark=%@" stringByAppendingString:kNYLogParamsCommon]
#define kAccountProductsUrl [@"app/FindAccountProductListForApp.jsp?callback=%@&accountId=%@&pageNo=%@&pageSize=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kAccountProductDetailUrl [@"app/FindAccountProductSingleForApp.jsp?callback=%@&accountId=%@&productId=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kAccountDynamicListUrl  [@"app/FindExistPersistProductAttachInfoListForApp.jsp?callback=%@&accoutId=%@&productId=%@&objectType=&isNew=2&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kAccountTradeDetailUrl  [@"app/FindDealListbyAccountidAndProductIdForApp.jsp?callback=%@&accountId=%@&productId=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kDynamicDetailUrl   [@"app/FindObjectRelAttachByPkIdForApp.jsp?callback=%@&accountId=%@&articleId=%@&articleRefId=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kOnlineProductAdUrl [@"app/FindAppProductBulletin.jsp?callback=%@&typeCustomer=%@&updateTime=%@" stringByAppendingString:kNYLogParamsCommon]
#define kGetAppVersionUrl   [@"app/GetAppVersion.jsp" stringByAppendingString:kNYLogCommon]
#define kLogoutUrl          [@"app/LoginOutApp.jsp?callback=%@&loginLogId=%@" stringByAppendingString:kNYLogParamsCommon]

#define kAboutUsUrl         @"app/aboutNoahwm/about.html"
#define kAboutGradeUrl      @"app/aboutNoahwm/grade.html"
#define kAboutServiceUrl    @"app/aboutNoahwm/service.html"

//Notification Keys
#define kActiveNaviSwipeGestureNotification @"ActiveNaviSwipeGestureNotification"
#define kActiveNaviPanGestureNotification   @"ActiveNaviPanGestureNotification"
//View logic
#define kLoadLeftMenuFirstTabNotification   @"LoadLeftMenuFirstTabNotification"
#define kRefreshPersonalInfoNotification    @"RefreshPersonalInfoNotification"
#define kSucceedGetPersonalInfoNotification @"SucceedGetPersonalInfoNotification"
#define kShowPannelViewNotification         @"ShowPannelViewNotification"
#define kShowLeftMenuNotification           @"ShowLeftMenuNotification"
#define kShowRightMenuNotification          @"ShowRightMenuNotification"
#define kHideMenuNotification               @"HideMenuNotification"
#define kShowLoginViewNotification          @"ShowLoginViewNotification"
#define kShowApplyAuthViewNotification      @"ShowApplyAuthViewNotification"
#define kShowPersonalInfoViewNotification   @"ShowPersonalInfoViewNotification"
#define kShowSettingViewNotification        @"ShowSettingViewNotification"
#define kShowPatternLockViewNotification    @"ShowPatternLockViewNotification"
#define kShowOnlineProsViewNotification     @"ShowOnlineProsViewNotification"
#define kHidePatternLockViewNotification    @"HidePatternLockViewNotification"
#define kShowYuyueDetailViewNotification    @"ShowYuyueDetailViewNotification"
#define kShowFilterViewNotification         @"ShowFilterViewNotification"
#define kHideFilterViewNotification         @"HideFilterViewNotification"
#define kCollectProductNotification         @"CollectProductNotification"
#define kmyKeepFreshNotification            @"MyKeepFreshNotification"
#define kShowMyPrebookNotification          @"ShowMyPrebookNotification"
#define kShowMyKeepNotification             @"ShowMyKeepNotification"
#define kShowMyReminderNotification         @"ShowMyReminderNotification"
#define kMyReminderReduceNotification       @"MyReminderReduceNotification"
#define kFilterProYuyueListNotification     @"FilterProYuyueListNotification"
#define kShowAccountProsViewNotification    @"ShowAccountProsViewNotification"
#define kShowDynamicDetailViewNotification  @"ShowDynamicDetailViewNotification"
#define kShowYuyueListViewNotification      @"ShowYuyueListViewNotification"
#define kShowUserGradeViewNotification      @"ShowUserGradeViewNotification"
#define kReloadPersonInfoViewNotification   @"ReloadPersonInfoViewNotification"

// 
#define kUserChangeNotification             @"UserChangeNotification"
#define kAsynMenuNotification               @"AsynMenuNotification"
#define kSelectedBlanchCityNotification     @"SelectedBlanchCityNotification"
#define kChangeNameSucceedNotification      @"ChangeNameSucceedNotification"
#define kPatternSettingReloadNotification   @"PatternSettingReloadNotification"
#define kShowkFeedbackWebNotification       @"ShowFeedbackWebNotification"
#define kIconChangedNotification            @"IconChangedNotification"
#define kShowPhoneCallNotification          @"ShowPhoneCallNotification"
#define kRefreshApplyAuthNotificaiton       @"RefreshApplyAuthNotificaiton"
#define kShowAccountListFullScreenNotification  @"ShowAccountListFullScreenNotification"
#define kShowAccountListHalfScreenNotification  @"ShowAccountListHalfScreenNotification"

#define kDownloadRightMenuSuccessNotification    @"DownloadRightMenuSuccessNotification"
#define kRefreshOnlneProductsNotification   @"RefreshOnlneProductsNotification"
#define kRefreshYuyueProductsNotification   @"RefreshYuyueProductsNotification"

// typeKind
#define kCancelReasonTypeKind @"0010"
#define kBlanchTypeKind       @"0013"
#define productKindTypeKind   @"0036"

extern LockPageType lockPage;

@interface Constant : NSObject

@end

#endif
